<template>
    <div ref="rel" class="sanys">
        我是refdom对象
    </div>
  </template>
  
  <script setup>
  //调用ref 函数-rel对象
   const rel = ref(null)
   //在组件挂载完毕后，即在onMounted生命周期函数中获取dom对象
   onMounted(()=>{
    console.log(rel)
    console.log(rel.value)   //TODO:  <div ref="rel" class="sanys">我是refdom对象 </div>
    rel.value.innerHTML += 'DOM has been changed!';
    //修改背景颜色，将高度和宽度设置200px
    rel.value.style.height = '200px';
    rel.value.style.width = '200px';
    //修改背景颜色
    rel.value.style.backgroundColor = 'red';
   })
  
  </script>
  
  <style lang="scss" scoped>
  
  </style>